package com.devin.controller;

import com.devin.model.dto.CreateBilibiliDto;
import com.devin.model.dto.JsonResult;
import com.devin.model.entity.BiliVideo;
import com.devin.model.entity.Room;
import com.devin.service.BilibiliService;
import com.devin.service.RoomService;
import com.devin.util.BilibiliUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Optional;

/**
 *  
 *  @author devin
 *  @date 2020-04-11 20:53
 *  @version 1.0.2
*/

@ResponseBody
@Slf4j
@Controller
public class BilibiliAPI {


    private final RoomService roomService;

    private final BilibiliService bilibiliService;

    @Autowired
    public BilibiliAPI(RoomService roomService, BilibiliService bilibiliService) {
        this.roomService = roomService;
        this.bilibiliService = bilibiliService;
    }




    @RequestMapping("/getBilibiliById")
    public BiliVideo getBilibiliById(Long bilibiliId){
        log.info("获取b站视频：" + bilibiliId);
       return this.bilibiliService.getById(bilibiliId);
    }




}
